#include <iostream>
#include <vector>
#include <unordered_map>
#include <cstring>
#include <cmath>
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
#define endl '\n'
const int N = 2010, MOD = 1e9 + 7;
LL c[N][N];
LL a[N];
int n, m;
void init()
{
    for(int i = 0; i <= 2000; i++)
    {
        c[i][0] = 1;
        for(int j = 1; j <= i; j++)
        {
            c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % MOD;
        }
    }
}

void solve() 
{
    cin >> n >> m;
    for(int i = 1; i <= m; i++) cin >> a[i];
    init();
    LL ans = 0;
    for(int i = 0; i < n; i++)
    {
        LL t = c[n][i];
        for(int j = 1; j <= m; j++)
        {
            t = t * c[n - i - 1 + a[j]][n - i - 1] % MOD;
        }
        if(i & 1) ans -= t;
        else ans += t;
        ans = (ans % MOD + MOD) % MOD;
    }
    cout << ans << endl;
}

int main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int T = 1;
	// cin >> T;
	while(T--)
	{
        solve();
	}
	return 0;
}